<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script src="<s:url value="/script/jquery.js"/>" type="text/javascript"></script>
<script src="<s:url value="/script/util.js"/>" type="text/javascript"></script>
<script src="<s:url value="/script/validator1.05.js"/>" type="text/javascript"></script>
<script type="text/javascript">
<!--
	function commitForm(url){
		var dForm=document.forms[0];
		dForm.action=url;
		isValid=Validator.Validate(dForm,3);
		if(isValid){
			dForm.submit();
		}
	}

	function rollBackForm(url){
		var dForm=document.forms[0];
		dForm.action=url;
		dForm.submit();
	}
		
	function selectMainPerson(taskAssignId){
	    var url="<s:url value='/' escapeAmp='false'/>"+"organ/toOrganTree.action?type=&path=toPersonTree&module=checkbox&date=<%=System.currentTimeMillis()%>";
		var returnData=window.showModalDialog(url,null,"status:no;dialogWidth:650px;dialogHeight:600px;scroll:yes;");
		if(returnData){
		 	var idArr=returnData[0].split(",");
			var nameArr=returnData[1].split(",");
			$("#"+taskAssignId).empty();
		 	for (var i = 0 ; i < idArr.length ; i++) {
		 		$("#"+taskAssignId).addOption(nameArr[i],idArr[i]);
		 	}
		}
	}	
-->
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<form action="flowCommitTask.action" method="post">
<input type="hidden" name="flowTaskId" value="${taskView.procTranRecord.id }"/>
<table>
	<tr>
		<td style="text-align: right;">ID：</td>
		<td>${taskView.procTranRecord.id }</td>
	</tr>
	<tr>
		<td style="text-align: right;">任务名：</td>
		<td>${taskView.procTranRecord.processStep.name }</td>
	</tr>
	<tr>
		<td style="text-align: right;">开始时间：</td>
		<td>${taskView.procTranRecord.receiveTime }</td>
	</tr>
	<tr>
		<td style="text-align: right;">结束时间：</td>
		<td>${taskView.procTranRecord.transactTime }</td>
	</tr>
	<tr>
		<td style="text-align: right;">执行者：</td>
		<td>${taskView.procTranRecord.transactor.name }</td>
	</tr>
	<tr>
		<td style="text-align: right;">下一步骤：</td>
		<td>
			<s:iterator value="#request.taskView.childTaskNodeList">
			<div style="margin-top: 5px">
			<select name="taskNodeId" style="width:150px">
				<option value="<s:property value="id"/>"><s:property value="name"/></option>
			</select>
			<select name="userId" id="taskAssign-<s:property value="id"/>" style="width:150px" dataType="Require" msg="请选择人员">
				<option value="<s:property value="person.id"/>"><s:property value="person.name"/></option>
			</select>
			<button type="button" onclick="selectMainPerson('taskAssign-<s:property value="id"/>')">选择</button>
			<font color="red">*</font>
			</div>
			</s:iterator>
					
		</td>
	</tr>
	<tr>
		<td style="text-align: right;">审批内容：</td>
		<td><textarea id="commentComtentID" name="commentComtent" style="width: 300px;height: 80px">${taskView.procTranRecord.transactInfo }</textarea></td>
	</tr>
	<tr>
		<td></td>
		<td>
			<s:if test="#request.taskView.procTranRecord.state!='end'">
			<button id="commitTaskBt" type="button" onclick="commitForm('flowSaveTask.action')">保存</button>
			<button id="commitTaskBt" type="button" onclick="commitForm('flowCommitTask.action')">提交</button>
			<button id="commitTaskBt2" type="button" onclick="rollBackForm('flowRollBackTask.action')">回退</button>
			</s:if>
			<s:if test="#request.taskView.procTranRecord.state=='end'">
			<button id="commitTaskBt3" type="button" onclick="rollBackForm('flowRecyclingTask.action')">回收</button>
			</s:if>
			</td>
			
			
	</tr>						
</table>
</form>
</body>
</html>

